<div class="w100pre close_float" style="text-align:right;">
    <input type="hidden" id="export_type" data-url="{:url(request()->controller().'/'.request()->action())}/exporttype/excel" name="export_type" data-param='{"url":"$actionurl}&orderby={$orderby}&exporttype=excel"}' value="excel"/>
    <a class="btn btn-mini" href="javascript:void(0);" id="export_btn">{$Think.lang.ds_export}Excel</a>
</div>
<input type="hidden" id="orderby" name="orderby" value="{$orderby}"/>

<table class="ds-default-table">
    <thead>
    <tr class="thead sortbar-array">
	<th class="align-center">{$Think.lang.ds_goods}</th>
        {foreach name="statheader" item="v"}
      {present name="v.isorder"}
      {if $v.isorder == 1}
        <th class="align-center">
            <a ds_type="orderitem" href="" class="selected">{$v.text}<i></i></a>
        </th>
       {else}
        <th class="align-center">{$v.text}</th>
        {/if}
       {/present}
        {/foreach}
    </tr>
    </thead>
    <tbody id="datatable">
    {notempty name="statlist"}
    {foreach name="statlist" item="v"}
    <tr class="hover">
        {foreach name="statheader" item="h_v"}
        <td class="{$h_v.class ? $h_v.class : 'align-center'}">{$v[$h_v.key]}</td>
        {/foreach}
    </tr>
    {/foreach}
    {else}
    <tr class="no_data">
        <td colspan="11">{$Think.lang.no_record}</td>
    </tr>
   {/notempty}
    </tbody>
</table>
{$show_page|raw}
<script>
    jQuery.browser={};(function(){jQuery.browser.msie=false; jQuery.browser.version=0;if(navigator.userAgent.match(/MSIE ([0-9]+)./)){ jQuery.browser.msie=true;jQuery.browser.version=RegExp.$1;}})();
</script>
<script src="{$Think.PLUGINS_SITE_ROOT}/jquery.poshytip.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        //Ajax提示
        $('.tip').poshytip({
            className: 'tip-yellowsimple',
            showTimeout: 1,
            alignTo: 'target',
            alignX: 'center',
            alignY: 'top',
            offsetY: 5,
            allowTipHover: false
        });

        $('#statlist').find('.demo').ajaxContent({
            event:'click', //mouseover
            loaderType:"img",
            loadingMsg:"{$Think.ADMIN_SITE_ROOT}/images/treetable/transparent.gif",
            target:'#statlist'
        });
        $("[ds_type='orderitem']").ajaxContent({
            event:'click',
            loaderType:"img",
            loadingMsg:"{$Think.ADMIN_SITE_ROOT}/images/treetable/transparent.gif",
            target:'#statlist'
        });

        //导出图表
        $("#export_btn").click(function(){
            var item = $("#export_type");
            var type = $(item).val();
            if(type == 'excel'){
                export_xls(item.attr('data-url').replace('.html',''));
            }
        });
    });
</script>